import request from '@/common/request.js'

const api = {}
const LOGIN_PATH = '/login/in' // 接口名
const IMG_PATH = '/image' // 接口名
const WEN_ZH = '/webPortal/getContent'
const MENU = '/webPortal/getColumnParent'
const ACTLIST = '/actMember/app'
const CAPTCHA_PATH = '/captcha/base64'
const LOGIN_PATHS = '/login/in'
const USER_INFO = '/user/u'
const USER_JOIN = '/actMember/join/'
const USER_SIGN = '/actMember/sign/'
const ACTDETAIL = '/activity/'

// 注册请求方法 getContentById为例
api.getContentById = params => request.globalRequest(GETCONTENTBYID_PATH, 'GET', params)
api.upload = params => request.globalRequest(IMG_PATH, 'POST', params)
api.getAticle = params => request.globalRequest(WEN_ZH, 'GET', params)
api.getMenu = params => request.globalRequest(MENU, 'GET', params)
api.getActList = params => request.globalRequest(ACTLIST, 'GET', params)
api.getActDetail = id => request.globalRequest(ACTDETAIL + id, 'GET')
api.getCaptch = params => request.globalRequest(CAPTCHA_PATH, 'GET', params)
api.login = params => request.globalRequest(LOGIN_PATHS, 'POST', params)
api.loginInfo = params => request.globalRequest(LOGIN_PATHS, 'get', params)
api.userJoin = id => request.globalRequest(USER_JOIN + id , 'put')
api.userSign = id => request.globalRequest(USER_SIGN + id , 'put')
export default api